<?php
namespace people;

use Exception;

abstract class Person {
	
	private $name;
	private $address;
	
	public function __construct($name, $address) {
		
		$this->setName($name);
		$this->setAddress($address);
	}
	
	public function __destruct() {
		
	}
	
	public function setName($name) {
		
		if($name == "" || $name == NULL) {
			
			throw new Exception("Name parameter can't be null or empty string");
		}
		
		if(!is_string($name)) {
			
			throw new Exception("Name parameter mus be a string value!");
		}
		
		$this->name = $name;
	}
	
	public function getName() {
		
		return $this->name;
	}
	
	public function setAddress($address) {
		
		if($address == "" || $address == NULL) {
				
			throw new Exception("Address parameter can't be null or empty string");
		}
		
		if(!is_string($address)) {
				
			throw new Exception("Address parameter mus be a string value!");
		}
		
		$this->address = $address;
	}
	
	public function getAddress() {
		
		return $this->address;
	}
}